package com.yunji.base.service;

import com.yunji.base.dao.IShortCutDao;
import com.yunji.base.domain.ShortCutMenuDO;
import com.yunji.base.vo.ShortCutVO;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.user.service.impl
 * @Title: ShortCutServiceImpl
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-09-05 09:46:37      V1.0        HuaAo       新建类
 */
@Component
public class ShortCutService {

    @Resource
    IShortCutDao shortCutDao;


    public boolean update(ShortCutMenuDO update) {
        return shortCutDao.updateById(update);
    }

    public boolean updateByMenuIdAndUserId(Long menuId, Long userId) {
        return shortCutDao.updateByMenuIdAndUserId(menuId,userId);
    }

    public boolean create(ShortCutMenuDO create) {
        return shortCutDao.save(create);
    }

    public List<ShortCutVO> listByUserId(Long userId, Integer status) {
        return shortCutDao.listByUserId(userId, status);
    }
}